/*
 * @Date: 2024-07-11 11:06:45
 * @Auth: 463997479@qq.com
 * @LastEditors: 463997479@qq.com
 * @LastEditTime: 2024-07-17 11:22:23
 * @FilePath: \react-oil-station-manage\src\utils\auth.ts
 */
/*
 * @Date: 2024-07-11 11:06:45
 * @Auth: 463997479@qq.com
 * @LastEditors: 463997479@qq.com
 * @LastEditTime: 2024-07-11 11:07:08
 * @FilePath: \react-oil-station-manage\src\utils\auth.ts
 */

import Cookies from 'js-cookie';

const TokenKey = 'Admin-Oil';
const UserKey = 'User-Key';

export function getToken() {
  return JSON.parse(Cookies.get(TokenKey));
}

export function setToken(token: any) {
  return Cookies.set(TokenKey, JSON.stringify(token));
}

export function removeToken() {
  return Cookies.remove(TokenKey);
}

export function getUser() {
  return JSON.parse(Cookies.get(UserKey));
}

export function setUser(user: any) {
  return Cookies.set(UserKey, JSON.stringify(user));
}

export function removeUser() {
  return Cookies.remove(UserKey);
}
